package com.fenghongzhang.module_look

import android.content.ComponentName
import android.content.Intent
import android.content.ServiceConnection
import android.os.Bundle
import android.os.IBinder
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.fenghongzhang.module_play.service.aidl.IMyAidlInterface

class LookActivity : AppCompatActivity() {

//    private val mServiceConnection = object : ServiceConnection {
//        override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
//            val binder =   IMyAidlInterface.Stub.asInterface(service)
//            val add = binder.add(1, 1)
//            println(add)//2
//
//        }
//
//        override fun onServiceDisconnected(name: ComponentName?) {
//
//        }
//
//    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_look)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }
//        val intent = Intent() //显示意图
//        intent.`package` = "com.fenghongzhang.module_play"
//        intent.action = "com.example.android.play.service.MyService"
//        bindService(intent, mServiceConnection, BIND_AUTO_CREATE)
    }
}